#ifndef _VELOCITYPLAN_H_
#define _VELOCITYPLAN_H_



#ifdef __cplusplus
extern "C"{
#endif

#ifdef VELOCITYMODE_API_EXPORTS
#define VELOCITYPLAN_API	__declspec(dllexport)
#else
#define VELOCITYPLAN_API	__declspec(dllexport)
#endif

#define VEL_OK										0
#define VEL_ENDPART									5

#define VEL_ERROR_SPEEDS							1
#define VEL_ERROR_STARTSPEED						2
#define VEL_ERROR_ENDSPEED							3
#define VEL_ERROR_STEADYSPEED						4



/**********************************************LINEAR MODE****************************************/
typedef struct
{
	float vs;	// start speed
	float ve;	// end speed
	float vm;   // max speed
	float acc; // constant acc
	float t1;	// acc time
	float t2;	// steady time
	float t;		// total time
	float p1;	// the end of acc
	float p2;	// the end of steady
	float s;    // total distance
}LINEAR_DATA;

VELOCITYPLAN_API int Linear_Plan(LINEAR_DATA *plineardata);
VELOCITYPLAN_API int Linear_Cal(LINEAR_DATA *plineardata, float t, float *pos, float *vc);


#ifdef __cplusplus
}
#endif


#endif